package com.area.controller;


import com.area.entity.Producttype;
import com.area.service.IProducttypeService;
import com.code.domain.AjaxResult;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 前端控制器 分类管理
 * </p>
 *
 * @author guanfenga@yonyou.com
 * @since 2023-01-09
 */
@Controller
@ApiOperation(value = "商品分类", notes = "商品分类")
@RequestMapping("/producttype")
@Slf4j
@CrossOrigin
public class ProducttypeController {

    @Autowired
    private IProducttypeService producttypeService;


    @ApiOperation(value = "查询分类列表", notes = "查询分类列表")
    @GetMapping("queryProductTypeAll")
    public @ResponseBody AjaxResult queryProductTypeAll(Producttype producttype,
                                                        HttpServletResponse request,
                                                        HttpServletResponse response) {
        List<Producttype> list = producttypeService.queryProductTypeAll(producttype);
        log.info("查询分类列表=>" + list);
        return new AjaxResult(0, "操作成功", list);
    }


}
